import request from "@/utils/request.js";



// 登录方法
export const login = (data, failHandle) => {
	let option = {
		method: "post",
		loading: true,
		failHandle: failHandle
	};
	// return request('/api/student/login', data, option)
	//新登录接口不需要传courseId
	return request('/api/student/new/login', data, option)
}
// 退出登录
export const exitLogin = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/student/logout', data, option)
}
// 获取科目
export const coursList = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/student/course/list', data, option)
}
// 获取科目树形
export const treeStudentCourse = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/student/multi/course/list', data, option)
}
// 商家登录
export const saleLogin = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/login', data, option)
}
// 商家退出
export const saleLogout = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/logout', data, option)
}
// 注册
export const coursRegister = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/register', data, option)
}
// 注册
export const coursCaptcha = (data) => {
	let option = {
		method: "post",
		loading: true,
	};
	return request('/api/sale/captcha', data, option)
}

// 重置密码
export const resetPasswordApi = (data) => {
	let option = {
		method: "PUT",
		loading: true,
	};
	return request('/api/sale/password/reset', data, option)
}
// 修改密码
export const editPasswordApi = (data) => {
	let option = {
		method: "PUT",
		loading: true,
	};
	return request('/api/sale/password', data, option)
}
// 免费科目
export const listFreeCourse = () => {
	let option = {
		method: "GET",
		loading: true,
	};
	return request('/api/open/sale/course/free/list', {}, option)
}
// 学员注册
export const studentRegister = (data) => {
	let option = {
		method: "POST",
		loading: true,
	};
	return request('/api/sale/student/register', data, option)
}
